import {getCart} from 'network/cart';

const actions = {
    updateCart({commit}) {
        getCart().then(res=>{
            // res.data[0].num
            let sum = 0;
            res.data.map(item => {
                sum += item.num;
            })
            commit('addCart', {count:sum || 0});
        })
    }
}

export default actions;